package com.example.ploy4j.dto.mapper;

import com.example.ploy4j.dto.ServerConfigDto;
import com.example.ploy4j.entity.ServerConfig;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(componentModel = "spring", nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface ServerConfigMapper {

    ServerConfigMapper INSTANCE = Mappers.getMapper(ServerConfigMapper.class);

    ServerConfigDto toDto(ServerConfig entity);

    List<ServerConfigDto> toDtoList(List<ServerConfig> entities);

    ServerConfig toEntity(ServerConfigDto dto);

    void updateEntityFromDto(ServerConfigDto dto, @MappingTarget ServerConfig entity);

} 